package com.fmsz.xmly.adapters.classify.tag;

import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

/**
 * Created by Administrator on 2016/12/12.
 */

public class TagHotPagerAdapter extends PagerAdapter {

    private ImageView[] datas;

    public TagHotPagerAdapter(ImageView[] datas) {
        this.datas = datas;
    }

    @Override
    public int getCount() {
        return datas.length;
    }

    @Override
    public boolean isViewFromObject(View view, Object object) {
        return view==object;
    }

    @Override
    public Object instantiateItem(ViewGroup container, int position) {
        container.addView(datas[position]);
        return datas[position];
    }

    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
        container.removeView(datas[position]);
    }
}
